# 将python之禅的内容 读取 进来 并写入一个新的文件
#
# file1 = open("data/python之禅")
# file2 = open("data/newPython之禅", mode="w")
#
# file2.writelines(file1.readlines())
#
# file1.close()
# file2.close()


# with
# 使用with open 可以不用手动关闭文件，让代码更加 简练
# 与上面注释的代码 效果是一样的
with open("data/python之禅") as file1:
    with open("data/newPython之禅", mode="w") as file2:
        file2.writelines(file1.readlines())
